<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/22
 * Time: 13:16
 */
namespace phpfuntions\mp_math;
//进制转换 函数　

class myphp_math_convert
{
    /**
     * base_convert 函数：在任意进制之间转换数字　
     * @access public
     * @return
     */
    public static function base_convert ($number, $frombase, $tobase) {
        return base_convert($number, $frombase, $tobase );

    }

    /**
     * bindec 函数：二进制转换为十进制　　
     * @access public
     * @return
     */
    public static function bindec ($binary_string) {
        return bindec($binary_string );

    }

    /**
     * decbin 函数：十进制转换为二进制　
     * @access public
     * @return
     */
    public static function decbin ($number) {
        return decbin( $number);

    }

    /**
     * dechex 函数：十进制转换为十六进制　
     * @access public
     * @return
     */
    public static function dechex ($number) {
        return dechex( $number);

    }

    /**
     * decoct 函数：十进制转换为八进制　
     * @access public
     * @return
     */
    public static function decoct ($number) {
        return decoct($number );

    }

    /**
     * hexdec 函数：十六进制转换为十进制　
     * @access public
     * @return
     */
    public static function hexdec ($hex_string) {
        return hexdec( $hex_string);

    }

    /**
     * octdec 函数：八进制转换为十进制　
     * @access public
     * @return
     */
    public static function octdec ($octal_string) {
        return octdec($octal_string );

    }
}